import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        /*Scanner scanner=new Scanner(System.in);
        String s=scanner.next();
        int x = firstUniqChar(s);
        System.out.println(x);*/
        /*Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        String[] tmp=s.split(" ");
        System.out.println(tmp[tmp.length-1].length());*/

        Scanner scanner=new Scanner(System.in);

        while(scanner.hasNextLine()){
            String s=scanner.nextLine();
            System.out.println(isPalindrome(s));
        }

    }
    public static int firstUniqChar(String s) {

        int[] tmp=new int[26];
        for (int i = 0; i < s.length(); i++) {
            tmp[s.charAt(i)-'a']++;
        }

        for (int i = 0; i < s.length(); i++) {
            if(tmp[s.charAt(i)-'a']==1){
                return i;
            }
        }
        return -1;
    }



    public static boolean isPalindrome(String s) {
        s = s.toLowerCase();
        StringBuffer stringBuffer=new StringBuffer();
        for (int i = 0; i < s.length(); i++) {
            if(s.charAt(i)>='a'&&s.charAt(i)<='z'||s.charAt(i)>='0'&&s.charAt(i)<='9'){
                stringBuffer.append(s.charAt(i));
            }
        }
        s=stringBuffer.toString();
        StringBuffer stringBufferx=new StringBuffer(s);
        StringBuffer tmp=new StringBuffer(stringBufferx);
        stringBuffer.reverse();
        String s1=stringBufferx.toString();
        String s2=tmp.toString();
        if(s1.equals(s2)){
            return true;
        }else{
            return false;
        }
    }
}
